From 1af39383d6131665abcfcad7254e6dc0f01bb1a6 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 4 Mar 2004 21:58:26 +0000 Subject: [PATCH] Don't open/close the file, just check for existence with g_file_test(). Thu Mar 4 16:54:30 2004 Owen Taylor * gtk/gtkrc.c (gtk_rc_check_pixmap_dir): Don't open/close the file, just check for existence with g_file_test(). This is considerably cheaper, and lack-of-permissions for pixmap dirs is pathological. Wed Mar 3 17:53:21 2004 Owen Taylor * gtk/gtksocket.c (gtk_socket_class_init): Overide show_all/hide_all to be gtk_widget_show/gtk_widget_hide, since we don't want to propagate to the in-process plug, if any. (#122949, Michael Meeks) --- ChangeLog | 15 +++++++++++++++ ChangeLog.pre-2-10 | 15 +++++++++++++++ ChangeLog.pre-2-4 | 15 +++++++++++++++ ChangeLog.pre-2-6 | 15 +++++++++++++++ ChangeLog.pre-2-8 | 15 +++++++++++++++ gtk/gtkrc.c | 10 +++------- gtk/gtksocket.c | 6 ++++++ 7 files changed, 84 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57a4b73c2c..0130e54550 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Thu Mar 4 16:54:30 2004 Owen Taylor + + * gtk/gtkrc.c (gtk_rc_check_pixmap_dir): Don't + open/close the file, just check for existence + with g_file_test(). This is considerably cheaper, + and lack-of-permissions for pixmap dirs is + pathological. + +Wed Mar 3 17:53:21 2004 Owen Taylor + + * gtk/gtksocket.c (gtk_socket_class_init): Overide + show_all/hide_all to be gtk_widget_show/gtk_widget_hide, + since we don't want to propagate to the in-process + plug, if any. (#122949, Michael Meeks) + Thu Mar 4 15:20:55 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (update_appearance): show the 'New diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 57a4b73c2c..0130e54550 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,18 @@ +Thu Mar 4 16:54:30 2004 Owen Taylor + + * gtk/gtkrc.c (gtk_rc_check_pixmap_dir): Don't + open/close the file, just check for existence + with g_file_test(). This is considerably cheaper, + and lack-of-permissions for pixmap dirs is + pathological. + +Wed Mar 3 17:53:21 2004 Owen Taylor + + * gtk/gtksocket.c (gtk_socket_class_init): Overide + show_all/hide_all to be gtk_widget_show/gtk_widget_hide, + since we don't want to propagate to the in-process + plug, if any. (#122949, Michael Meeks) + Thu Mar 4 15:20:55 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (update_appearance): show the 'New diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 57a4b73c2c..0130e54550 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,18 @@ +Thu Mar 4 16:54:30 2004 Owen Taylor + + * gtk/gtkrc.c (gtk_rc_check_pixmap_dir): Don't + open/close the file, just check for existence + with g_file_test(). This is considerably cheaper, + and lack-of-permissions for pixmap dirs is + pathological. + +Wed Mar 3 17:53:21 2004 Owen Taylor + + * gtk/gtksocket.c (gtk_socket_class_init): Overide + show_all/hide_all to be gtk_widget_show/gtk_widget_hide, + since we don't want to propagate to the in-process + plug, if any. (#122949, Michael Meeks) + Thu Mar 4 15:20:55 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (update_appearance): show the 'New diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 57a4b73c2c..0130e54550 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,18 @@ +Thu Mar 4 16:54:30 2004 Owen Taylor + + * gtk/gtkrc.c (gtk_rc_check_pixmap_dir): Don't + open/close the file, just check for existence + with g_file_test(). This is considerably cheaper, + and lack-of-permissions for pixmap dirs is + pathological. + +Wed Mar 3 17:53:21 2004 Owen Taylor + + * gtk/gtksocket.c (gtk_socket_class_init): Overide + show_all/hide_all to be gtk_widget_show/gtk_widget_hide, + since we don't want to propagate to the in-process + plug, if any. (#122949, Michael Meeks) + Thu Mar 4 15:20:55 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (update_appearance): show the 'New diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 57a4b73c2c..0130e54550 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,18 @@ +Thu Mar 4 16:54:30 2004 Owen Taylor + + * gtk/gtkrc.c (gtk_rc_check_pixmap_dir): Don't + open/close the file, just check for existence + with g_file_test(). This is considerably cheaper, + and lack-of-permissions for pixmap dirs is + pathological. + +Wed Mar 3 17:53:21 2004 Owen Taylor + + * gtk/gtksocket.c (gtk_socket_class_init): Overide + show_all/hide_all to be gtk_widget_show/gtk_widget_hide, + since we don't want to propagate to the in-process + plug, if any. (#122949, Michael Meeks) + Thu Mar 4 15:20:55 2004 Jonathan Blandford * gtk/gtkfilechooserdefault.c (update_appearance): show the 'New diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index e222174db1..905ae29a2a 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -2973,13 +2973,9 @@ gtk_rc_check_pixmap_dir (const gchar *dir, const gchar *pixmap_file) gint fd; buf = g_build_filename (dir, pixmap_file, NULL); - - fd = open (buf, O_RDONLY); - if (fd >= 0) - { - close (fd); - return buf; - } + + if (g_file_test (buf, G_FILE_TEST_EXISTS)) + return buf; g_free (buf); diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c index 3a76cfbe50..3f59ceb4ab 100644 --- a/gtk/gtksocket.c +++ b/gtk/gtksocket.c @@ -191,6 +191,12 @@ gtk_socket_class_init (GtkSocketClass *class) widget_class->key_press_event = gtk_socket_key_event; widget_class->key_release_event = gtk_socket_key_event; widget_class->focus = gtk_socket_focus; + + /* We don't want to show_all/hide_all the in-process + * plug, if any. + */ + widget_class->show_all = gtk_widget_show; + widget_class->hide_all = gtk_widget_hide; container_class->remove = gtk_socket_remove; container_class->forall = gtk_socket_forall; -- 2.30.2